# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=bliss
pkgver=0.77
pkgrel=2
pkgdesc='A library for computing automorphism groups and canonical forms of graphs'
arch=(loong64 x86_64)
url='https://users.aalto.fi/~tjunttil/bliss/'
license=(GPL3)
depends=(gmp)
makedepends=(cmake)
source=(https://users.aalto.fi/~tjunttil/bliss/downloads/$pkgname-$pkgver.zip
        digraph_heuristic.patch
        make-install.patch)
sha256sums=('acc8b98034f30fad24c897f365abd866c13d9f1bb207e398d0caf136875972a4'
            '584dbb948c5ad39c32373a3736d457ef5ecf0c23b552d9e925fa0ace61652461'
            '1cbbcf33c779c832787ad2b6770643b2a3f9ddbe2077217820fe5ac5ca902f16')

prepare() {
  patch -d $pkgname-$pkgver -p1 < digraph_heuristic.patch # Fix splitting heuristics for digraphs
  patch -d $pkgname-$pkgver -p1 < make-install.patch # Add make install target
}

build() {
  cmake -B build -S bliss-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DUSE_GMP=OFF
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
